-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ci): save cache on build-main
workflows and only restore cache on docker-build-and-push-main
workflows
#4865
Conversation
Signed-off-by: Yutaka Kondo <[email protected]>
Signed-off-by: Yutaka Kondo <[email protected]>
Signed-off-by: Yutaka Kondo <[email protected]>
Signed-off-by: Yutaka Kondo <[email protected]>
Signed-off-by: Yutaka Kondo <[email protected]>
Signed-off-by: Yutaka Kondo <[email protected]>
The workflow namings are unclear, so I would like to refactor and rename them in another PR. |
Signed-off-by: Yutaka Kondo <[email protected]>
This reverts commit adced0d.
This reverts commit 7004dbe.
This reverts commit e6d62e4.
Unfortunately, this PR still has an issue where the
https://github.com/autowarefoundation/autoware/actions/runs/9500467708/job/26183604143#step:6:13 https://github.com/autowarefoundation/autoware/actions/caches |
This is happens because the workflow trigger of schedule isolates the cache. For this to work as intended, Also
Reasons:
The reason for restore-keys: |
ccache-build-main-${{ runner.arch }}-humble- Will fetch the most fresh version anyways. As long as it is unique, it will be enough. @youtalk -san, I know you are busy this week and I would like to implement all I've mentioned until wednesday, is that OK? |
@xmfcx It's my pleasure! Please go ahead. |
… on `docker-build-and-push-main` workflows (autowarefoundation#4865) * fix ccache_dir Signed-off-by: Yutaka Kondo <[email protected]> * update build-main Signed-off-by: Yutaka Kondo <[email protected]> * restore only Signed-off-by: Yutaka Kondo <[email protected]> * reorder Signed-off-by: Yutaka Kondo <[email protected]> * MUST REVERT Signed-off-by: Yutaka Kondo <[email protected]> * add cache-tag-suffix arg Signed-off-by: Yutaka Kondo <[email protected]> * rename Signed-off-by: Yutaka Kondo <[email protected]> * Revert "MUST REVERT" This reverts commit adced0d. * Revert "Revert "MUST REVERT"" This reverts commit 7004dbe. * Revert "Revert "Revert "MUST REVERT""" This reverts commit e6d62e4. --------- Signed-off-by: Yutaka Kondo <[email protected]>
Description
CCACHE_DIR
in Dockerfile #4863The
reproducible-containers/buildkit-cache-dance
action introduced in #4854, unfortunately, might not support extracting the cache from thedocker buildx bake
and only supportsdocker build
.I confirmed that replacing
docker/bake-action
withdocker/build-and-push-action
as per the official sample code does indeed enable the cache to work.https://github.com/reproducible-containers/buildkit-cache-dance?tab=readme-ov-file#examples
Therefore, in this PR, we will create a cache by running
docker/build-and-push-action
in thebuild-main
andbuild-main-self-hosted
workflows, which are scheduled to run daily, and in the sequentially executeddocker-build-and-push-main
anddocker-build-and-push-main-self-hosted
workflows, we will rundocker/bake-action
as in the past and only load the cache.It turns out that the cache was effective in #4854 because I forgot to delete the cache from the commit during my experiment, which caused the cache to be effective. I apologize for the oversight.
Tests performed
Using this commit to temporarily run the
build-main
workflows in this PR, we confirmed that the execution time from the second run onwards was drastically reduced from the previous 2.5 hours to 1 hour.https://autowarefoundation.github.io/autoware-ci-metrics/
Effects on system behavior
Not applicable.
Interface changes
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.